package com.tanhua.sso.controller;

import com.tanhua.sso.service.UserInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import java.util.Map;

@RestController
@RequestMapping("user")
public class UserInfoController {
    @Autowired
    private UserInfoService userInfoService;
    @PostMapping("loginReginfo")
    public ResponseEntity<Object> saveUserInfo(@RequestBody Map<String,String> param,@RequestHeader("Authorization")  String token){
            userInfoService.saveUserInfo(param,token);
            return null;
    }

    @PostMapping("loginReginfo/head")
    public ResponseEntity<Object> savaUserLogo(@RequestParam("headPhoto") MultipartFile file,
                                                                                                @RequestHeader("Authorization") String token){
        boolean result= userInfoService.savaUserLogo(file,token);

        return null;
    }

}
